package com.heima.producer;


import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.test.context.junit4.SpringRunner;

@SpringBootTest(classes = KafkaProducerApplication.class)
@RunWith(SpringRunner.class)
public class test {
    @Autowired
    private KafkaTemplate kafkaTemplate;

    @Test
    public void test1(){
        kafkaTemplate.send("kafka.topic1","kafka","hello kafka !");
    }
}
